package com.marvels.approve.process.service;

import java.util.List;
import java.util.Map;

import com.marvels.approve.loan.dto.McamLoanApplyInfoDTO;
import com.marvels.approve.process.dto.CompleteProcessDTO;
import com.marvels.approve.process.dto.DecisionRefusListDTO;
import com.marvels.approve.process.dto.HandleProcessDTO;
import com.marvels.approve.process.dto.HungUpConditionDTO;
import com.marvels.approve.process.dto.LoanApplyCaseDTO;
import com.marvels.approve.process.dto.RiskParamsDTO;
import com.marvels.approve.process.dto.RiskResultDTO;
import com.marvels.common.exception.MarvelsBusinessException;

/**工单跟踪
 * @author 何杰
 * 2018年4月11日
 */
public interface ILoanApplyCaseService {
	/**条件查询
	 * @author 何杰
	 * 2018年4月11日
	 * @param loanApplyCaseDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<LoanApplyCaseDTO> findLoanApplyCases(LoanApplyCaseDTO loanApplyCaseDTO)throws MarvelsBusinessException;
	/**条件查询  ,woChecking woApproval woSampling
	 * @author 何杰
	 * 2018年4月11日
	 * @param loanApplyCaseDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<LoanApplyCaseDTO> findSelfLoanApplyCases(LoanApplyCaseDTO loanApplyCaseDTO)throws MarvelsBusinessException;
	
	/**
	 * 查询决策拒绝列表数据
	 * @param decisionRefusListDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<Map<String, Object>> decisionRefusList(DecisionRefusListDTO decisionRefusListDTO)throws MarvelsBusinessException;
	
	/**
	 * 重新取件审批
	 * @param decisionRefusListDTO
	 * @throws MarvelsBusinessException
	 */
	public void reApproval(DecisionRefusListDTO decisionRefusListDTO)throws MarvelsBusinessException;
	
	/**通过主键ID查询LoanApplyCaseEntity
	 * @author 何杰
	 * 2018年4月11日
	 * @param id
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO findLoanApplyCase(Long id)throws MarvelsBusinessException;
	
	/**通过loanid查询case
	 * @param loanId
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO findLoanApplyCase(String loanId)throws MarvelsBusinessException;
	
	
	/**
	 * 查询共享平台数据
	 * @param loanId
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Map<String, Object> getSharedPlatformInfo(String loanId)throws MarvelsBusinessException;
	
	
	/**转件查询流程
	 * @author 何杰
	 * 2018年5月20日
	 * @param loanApplyCaseDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<LoanApplyCaseDTO> findLoanApplyCaseForTransfers(LoanApplyCaseDTO loanApplyCaseDTO)throws MarvelsBusinessException;
	
	/**根据用户权限获取能查想节点以及查询的节点
	 * @param handleProcessDTO     roleCodes  必有, queryNodes 必有
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<String> findUserNodes(HandleProcessDTO handleProcessDTO)throws MarvelsBusinessException;
	/**转件
	 * @param loanApplyCaseDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO transfersLoanApplyCase(LoanApplyCaseDTO loanApplyCaseDTO)throws MarvelsBusinessException;
	/**新增or更新
	 * @author 何杰
	 * 2018年4月11日
	 * @param opinion
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO saveLoanApplyCase(LoanApplyCaseDTO opinion)throws MarvelsBusinessException;
	
	/**通过权限查询客户待取件
	 * @author 何杰
	 * 2018年4月16日
	 * @param roles
	 * @return
	 */
	public Integer findWaitProcessNum(List<String> roles,List<String> nodes);
	
	/**
	 * @author 何杰
	 * 2018年5月14日
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<LoanApplyCaseDTO> findLoanApplyCases(HandleProcessDTO handleProcessDTO)throws MarvelsBusinessException;
	
	/**
	 * 获取取件单信息
	 * @param handleProcessDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO findLoanApplyCasesByLoanId(HandleProcessDTO handleProcessDTO)throws MarvelsBusinessException;
	
	/**取件
	 * @author 何杰
	 * 2018年5月14日
	 * @param loanApplyCase
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO pickupLoanApplyCases(LoanApplyCaseDTO loanApplyCase)throws MarvelsBusinessException;
	
	/**完成当前节点任务
	 * @author 何杰
	 * 2018年5月14日
	 * @param loanApplyCase
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO completeNode(CompleteProcessDTO completeProcessDTO)throws MarvelsBusinessException;
	
	/**开启流程
	 * @author 何杰
	 * 2018年5月14日
	 * @param loanApplyInfo
	 * @throws MarvelsBusinessException
	 */
	public String startFlow(McamLoanApplyInfoDTO loanApplyInfo)throws MarvelsBusinessException;
	
	/**结案处理
	 * @author 何杰
	 * 2018年5月16日
	 * @param loanApplyCaseDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyCaseDTO endNode(LoanApplyCaseDTO loanApplyCaseDTO)throws MarvelsBusinessException;
	
	
	/**
	 * 查询风险参数数据
	 * @param loanId
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public RiskParamsDTO getRiskParamsInfo(String loanId) throws MarvelsBusinessException;
	
	
	/**
	 * 计算年缴纳保费
	 * @param riskParamsDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public RiskParamsDTO payPremiumAnnualPayment(RiskParamsDTO riskParamsDTO) throws MarvelsBusinessException;
	
	
	
	
	/**
	 * 更新分险参数信息
	 * @param riskParamsDTO
	 * @throws MarvelsBusinessException
	 */
	public void updateRiskInfo(RiskParamsDTO riskParamsDTO) throws MarvelsBusinessException;
	
	
	
	
	
	
	/**
	 * 试算核电金额
	 * @param riskParamsDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public RiskResultDTO trialApprovedAmount(RiskParamsDTO riskParamsDTO) throws MarvelsBusinessException;
	
	
	/**
	 * 改变资金源试算
	 * @param riskParamsDTO
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public RiskParamsDTO fundChangeTrial(RiskParamsDTO riskParamsDTO) throws MarvelsBusinessException;
	
	
	
	/**
	 * 挂起操作
	 * @param dto
	 * @throws MarvelsBusinessException
	 */
	public void hungUp( HungUpConditionDTO dto) throws MarvelsBusinessException;
}
